<template>
  <el-button type="info" @click="read">{{ $t('读取') }}</el-button>
</template>

<script setup lang="ts">
import service from '@/service/index'
import { useConfigStore } from '@/store/config.store'
import { ElMessage } from 'element-plus'

const store = useConfigStore()
const read = () => {
  service.resetConfig().then(() => {
    ElMessage.success('读取成功！')

    store.dispatch('pull')
  })
}

defineExpose({read})
</script>
